package com.springboot.cloud.demos.feign.rest;

import com.springboot.cloud.common.core.entity.vo.Result;
import com.springboot.cloud.demos.feign.service.DictionaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DictionaryController {

    @Autowired
    private DictionaryService dictionaryService;


    @RequestMapping(value = "/open/dictionary/list", method = RequestMethod.GET)
    public Result list() {
        return dictionaryService.list();
    }

    @RequestMapping(value = "/open/dictionary", method = RequestMethod.GET)
    public Result query(@RequestParam("keyNo") String keyNo) {
        return dictionaryService.query(keyNo);
    }
}
